import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:graduation_project/common/StaticRatingBar.dart';
import 'package:like_button/like_button.dart';

class user_evaluation_mode extends StatefulWidget {
  user_evaluation_mode({Key key, this.cartoon_id}) : super(key: key);
  int cartoon_id;
  @override
  State<user_evaluation_mode> createState() => _user_evaluation_modeState();
}

class _user_evaluation_modeState extends State<user_evaluation_mode> {
  int ues_id = 100006;
  String header_image_url =
      'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F202005%2F03%2F20200503193405_QavAd.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1651841860&t=ef1ab5509bcf14053ca92ec2dbb36bb5';
  String ues_name = '月之菈妮';
  String evaluation_value = '你让魔女菈妮蒙羞！你让魔女菈妮蒙羞！你让魔女菈妮蒙羞！你让魔女菈妮蒙羞！';
  double grade = 9.9;
  int like_num = 2992;
  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.only(top: 8),
      child: Column(
        children: [
          Row(
            children: [
              Container(
                margin: EdgeInsets.only(left: 10, right: 4),
                height: 30,
                width: 30,
                // color: Colors.black26,
                clipBehavior: Clip.hardEdge,
                decoration: BoxDecoration(
                  color: Colors.black26,
                  borderRadius: BorderRadius.all(Radius.circular(50)),
                  // border: Border.all(width: 0, style: BorderStyle.none),
                ),
                child: Image.network(header_image_url),
              ),
              Container(
                margin: EdgeInsets.only(right: 4),
                child: Text(
                  ues_name,
                  style: TextStyle(fontSize: 11, color: Colors.black54),
                ),
              ),
              StaticRatingBar(
                size: 12.0,
                rate: grade / 2,
              ),
            ],
          ),
          Container(
              margin: EdgeInsets.only(top: 8),
              width: 320,
              child: Text(
                evaluation_value,
                style: TextStyle(fontSize: 11, color: Colors.black54),
              )),
          Container(
            margin: EdgeInsets.only(left: 12, top: 6, bottom: 6),
            child: Row(
              children: [
                LikeButton(
                    // ignore: missing_return
                    // circleColor: CircleColor(
                    //     start: Colors.black54,
                    //     end: Color.fromRGBO(50, 170, 255, 1)),
                    likeBuilder: (bool isLiked) {
                      print(isLiked);
                      return Image.asset(
                        'assets/images/common/cartoon/good.png',
                        color: isLiked
                            ? Color.fromRGBO(50, 170, 255, 1)
                            : Colors.black54,
                        // color: Colors.black26,
                      );
                    },
                    likeCount: like_num)
              ],
            ),
          )
        ],
      ),
    );
  }
}
